package com.chinatelecom.ifree.business.dao.invokelog.impl;

import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.chinatelecom.ifree.business.dao.invokelog.InvokeLogDao;
import com.chinatelecom.ifree.business.dao.order.impl.BaseDaoSupport;
import com.chinatelecom.ifree.business.domain.invokelog.InvokeLog;
@Repository
public class InvokeDaoImpl extends BaseDaoSupport<InvokeLog> implements InvokeLogDao {
	
	private static transient Logger logger = LoggerFactory.getLogger(InvokeDaoImpl.class) ;


	@Override
	public void saveLog(InvokeLog invokeLog) throws Exception {
		sql = "INSERT INTO invoke_log(serv_name,last_time,succ_flag,inparam,outparam , create_time,remark) VALUES(?,?,?,?,?,?,?)";
		
		super.saveEntity(invokeLog);
	}


	@Override
	public InvokeLog executeSingleResultSet(ResultSet rs) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}


	@Override
	public void executeSql(PreparedStatement statement, InvokeLog t)
			throws Exception {
		statement.setString(1, t.getServName());
		statement.setLong(2, t.getLastTime());
		statement.setLong(3, t.getSuccFlag());
		statement.setString(4, t.getInparam());
		statement.setString(5, t.getOutparam());
		statement.setDate(6, new Date(t.getCreateTime().getTime()));
		statement.setString(7, t.getRemark());
	}


	@Override
	public void executeBatchSql(PreparedStatement state, InvokeLog[] t)
			throws Exception {
		// TODO Auto-generated method stub
		
	}
}
